This page last changed on Apr 20, 2010 by dcline.

Install mpd service

This is used to configure a mpd ring running under the root account that will be used by users. This assumes you have 4 CPUs per each node and you may need to adjust this according to your cluster.

  1. Create mpd service file similar to the following
    /etc/rc.d/init.d/mpd
    !/bin/sh
    #
    # Start or stop system wide mpd daemon
    
    # Source the aved functions
    . /etc/profile.d/aved.sh
    
    case "$1" in
    start)
            # This assumes only nodes and not the master are listed in the mpd.hosts file
            # because the master is not typically listed as a worker node
            c=`wc -l $MPDIR/etc/mpd.hosts | awk '{print $1}'`
            # Add one to include the master
            ((c += 1))
            if [ ! -e '/tmp/mpd2.console_root' ]; then
                mpdboot --ncpus=4 --totalnum=$c --file="$MPDIR/etc/mpd.hosts --mpd=$MPDIR/bin/mpd.py"
             else
                echo "restarting mpd"
                mpdallexit
                mpdboot --ncpus=4 --totalnum=$c --file="$MPDIR/etc/mpd.hosts --mpd=$MPDIR/bin/mpd.py"
            fi
            mpdtrace
            ;;
    
    stop)
            if [ -e '/tmp/mpd2.console_root' ]; then
                mpdallexit
                #remove tmp file in case mpdallexit cmd fails
                if [ -e '/tmp/mpd2.console_root' ]; then
                    rm /tmp/mpd2.console_root
                fi
                echo "mpd daemon stopped"
            else
                echo "mpd daemon already stopped"
            fi
            ;;
    
    status)
            if [ -e '/tmp/mpd2.console_root' ]; then
                mpdtrace -l
            else
                echo "mpd daemon not running"
            fi
            ;;
    
        *)  echo "usage: $0 {start|stop|status}"
            ;;
    "/etc/rc.d/init.d/mpd" 53L, 1411C
  2. Then push to the other nodes
    cpush /etc/rc.d/init.d/mpd /etc/rc.d/init.d/mpd
    
  3. Start the mpd service
    service mpd start
    

    You should see the nodes all come up, something like (not necessarily in this order):

    beowulffish
    node1
    node4
    node3
    node2
    node5
    node8
    node6
    node7
    
Document generated by Confluence on Feb 03, 2026 14:12